/*
 * ConnectConfirmMessage.h
 *
 */

#ifndef CONNECTCONFIRMMESSAGE_H_
#define CONNECTCONFIRMMESSAGE_H_

#include "ariba/ariba.h"

using_serialization;

class ConnectConfirmMessage  : public ariba::Message
{
	VSERIALIZEABLE;
	
public:
    typedef enum
    {
        UNDEFINED = 0,
        ACCEPTED = 1,
        DENIED = 2
    } STATUS;

public:
	/// Default constructor, required for automatic de-serialization
	ConnectConfirmMessage();

	/// Convenient constructor for setting up a new chat message object
	ConnectConfirmMessage(bool accepted, uint32_t nonce);
	
	bool is_fine()
	{
	    return accepted == ACCEPTED;
	}
	
	uint32_t get_nonce()
	{
	    return nonce;
	}

	/// Default destructor
	virtual ~ConnectConfirmMessage();

	
private:
    /// Copy constructor (NOT IMPLEMENTED / FORBIDDEN)
    ConnectConfirmMessage(ConnectConfirmMessage &other);

    
private:
    uint8_t accepted;
	uint32_t nonce;
};

sznBeginDefault(ConnectConfirmMessage, X)
{
    X && accepted && nonce;
    
//    if ( accepted )
//    {
//    }
//    else
//    {
//    }
} sznEnd();

#endif /* CONNECTCONFIRMMESSAGE_H_ */
